package com.dongdongshop.service.impl;

import com.dongdongshop.annotation.Log;
import com.dongdongshop.mapper.TbTypeTemplateMapper;
import com.dongdongshop.pojo.TbTypeTemplate;
import com.dongdongshop.pojo.TbTypeTemplateExample;
import com.dongdongshop.service.TbTypeTemplateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@com.alibaba.dubbo.config.annotation.Service
public class TbTypeTemplateServiceImpl implements TbTypeTemplateService {

    @Autowired
    private TbTypeTemplateMapper tbTypeTemplateMapper;

    @Override
    @Log
    public List<TbTypeTemplate> getTypeInfo(String name) {
        List<TbTypeTemplate> list = tbTypeTemplateMapper.selectByName(name);

        return list;
    }

    @Override
    @Log
    public void insertTypeInfo(TbTypeTemplate tbTypeTemplate) {
        tbTypeTemplateMapper.insertSelective(tbTypeTemplate);
    }

    @Override
    @Log
    public TbTypeTemplate updateType(Long id) {
        return tbTypeTemplateMapper.selectByPrimaryKey(id);
    }

    @Override
    @Log
    public void updateTypeInfo(TbTypeTemplate tbTypeTemplate) {
        tbTypeTemplateMapper.updateByPrimaryKeySelective(tbTypeTemplate);
    }

    @Override
    @Log
    public void deleteTypeInfo(Long id) {
        tbTypeTemplateMapper.deleteByPrimaryKey(id);
    }


    @Override
    public TbTypeTemplate getBrand(Long id) {
        return tbTypeTemplateMapper.selectByPrimaryKey(id);
    }
}
